<?php

class Application_Model_Renting extends Sgit_Model
{  
    protected $_name = 'renting';
    protected $_primary = 'id';
    
    
    
    public function getRentings(){
        
        
        
       	try
		{
			$select = $this->getAdapter()->select();
            $importe='(SELECT SUM(coste*meses) FROM renting_conceptos WHERE id_renting=renting.id)';            
			$select->from( array( 'renting' ),array('*','importe'=>$importe));


            return $this->getAdapter()->fetchAll( $select );
			
		}
		catch ( exception $e )
		{
			return self::_verError($e);
		}
        
    }
    

}  




